package com.yiqi.lottery.feature.lottery.view.adapter;

import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.suozhang.framework.framework.AM;
import com.yiqi.lottery.R;
import com.yiqi.lottery.entity.bo.LuckySection;
import com.yiqi.lottery.entity.bo.SelectItem;

import java.util.List;

public class LuckyNumAdapter extends BaseQuickAdapter<SelectItem, BaseViewHolder> {

    public LuckyNumAdapter() {
        super(R.layout.item_lottery_lucky_num);
    }


    @Override
    protected void convert(BaseViewHolder helper, SelectItem selectItem) {
            helper.setText(R.id.tv_lucky_num, selectItem.getName() <= 9 ? "0" + selectItem.getName() : "" + selectItem.getName());


        TextView checkBox = helper.getView(R.id.tv_lucky_num);
        if (selectItem.getType() == 1) {
            checkBox.setBackground(AM.app().getResources().getDrawable(R.drawable.documentary_list_first_sign));

        } else if (selectItem.getType() == 2) {
            checkBox.setBackground(AM.app().getResources().getDrawable(R.drawable.documentary_list_first_blue));
        }

    }

}
